
#ifndef	__USBHID_H__
#define	__USBHID_H__

#include "libusb.h"

typedef struct {
	/* Handle to the actual device. */
	libusb_device_handle *device_handle;

	int interface_num;

	/* Indexes of Strings */
	int manufacturer_index;
	int product_index;
	int serial_index;

	/* Endpoint information */
	int input_endpoint;
	int output_endpoint;
	int input_ep_max_packet_size;

	struct libusb_transfer *transfer;
} usbhid_device;

usbhid_device *usbhid_open(unsigned short vid, unsigned short pid, int ifnum, libusb_transfer_cb_fn callback);
void usbhid_close(usbhid_device *hid_dev);
int usbhid_write(usbhid_device *hid_dev, int count, unsigned char *data);
int usbhid_thread(usbhid_device *hid_dev);

#endif	//__USBHID_H__
